package com.shtel.paas.monitorcenter.process.management.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shtel.paas.monitorcenter.process.management.entity.ProcessInfoParam;
import com.shtel.paas.monitorcenter.process.management.service.ProcessInfoService;
import com.shtel.paas.monitorcenter.process.management.service.processexporter.ProcessGaugeExports;
import com.shtel.paas.monitorcenter.util.commed.Cmd;
import com.shtel.paas.monitorcenter.util.commed.Command;
import com.shtel.paas.monitorcenter.util.commed.CommandGaugeExports;

/**
 * @ClassName
 * @Description Too
 * @Author ME
 * @Data 11:29
 **/
@Service
public class ProcessInfoServiceImpl implements ProcessInfoService {

    @Autowired
    private ProcessGaugeExports register;
    @Override
    public List<ProcessInfoParam> selectProcess(ProcessInfoParam param) {

         register.setParam(param);
         register = new ProcessGaugeExports().register();
        return register.lis;

    }

    @Override
    public String selectCommand(String ip, String command, String type) {
        List<Cmd> list = new ArrayList<Cmd>();
        Cmd cm = new Cmd(ip,command);
        list.add(cm);
        CommandGaugeExports p = new CommandGaugeExports();
        List<Command> cmd = p.getCommand(list);
        return cmd.get(0).getCommand();
     }
}
